pimpas.Listener = Class.create( );
pimpas.Extends(pimpas.Listener.prototype, pimpas.Object);
pimpas.Extends(pimpas.Listener.prototype,
	{
		callBack: function(obj, evt) {
			
		},
		initialize: function() {
			this.id = pimpas.globalID++;
			this.log = new pimpas.Log();
		}
	}
);

pimpas.ListenerSupport = Class.create( );

pimpas.Extends(pimpas.ListenerSupport.prototype, pimpas.Object);

pimpas.Extends(pimpas.ListenerSupport.prototype,
   {
	listeners: new Array(),
	initialize: function() {
		this.id = pimpas.globalID++;
		this.log = new pimpas.Log();
		this.listeners = new Array();
	},
	addListener: function(obj) {
		this.listeners.push(obj);
	},
	removeListener: function(obj) {
			this.listeners.remove(obj);								
	},
	clearListeners: function() {
		this.listeners = new Array();
	},
	callListeners: function() {
		var evt = arguments[0];
		var ar = new Array();
		ar.push(this);
		for(var i=0;i<arguments.length;i++) ar.push(arguments[i]);
		
		for(var i=0;i<this.listeners.length;i++)
			this.listeners[i].callBack.apply(this.listeners[i], ar);
		return evt;
	}
   }
);